﻿using AiMoInGH.PrinterForm;
using Grasshopper.Kernel;
using System.Threading;


namespace AiMoCore
{
    public abstract partial class GHCSharpScriptInstance
    {
        public GH_Component Component { get; private set; } = null;
        PrinterManager m_Printer = null;
        internal void SetComponent(GH_Component component, PrinterManager printer)
        {
            m_Printer = printer;
            Component = component;
        }
        public abstract void SolveInstance();
        public virtual void OnLoad() { }
        public virtual void OnDelete() { }
        public virtual void BeforeSolveInstance() { }
        public virtual void AfterSolveInstance() { }




        public void Sleep(int milliSeconds)
        {
            Thread.Sleep(milliSeconds);
        }

        public void Print(string text)
        {
            m_Printer.Add(text);
        }
        public void Print(string content, params object[] args)
        {
            m_Printer.Add(content, args);
        }
        public void Print(object obj)
        {
            m_Printer.Add(obj);
        }
    }
}